home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000140_icon-group-sender_Thu Nov 21 17:20:43 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id gAM0KfY13144
  4.     for icon-group-addresses; Thu, 21 Nov 2002 17:20:41 -0700 (MST)
  5. Message-Id: <200211220020.gAM0KfY13144@baskerville.CS.Arizona.EDU>
  6. From: "jsampson-indexer" <jsampson@indexes.u-net.com>
  7. To: "Steve Wampler" <swampler@noao.edu>, <icon-group@cs.arizona.edu>
  8. Subject: RE: tab in regex
  9. Date: Thu, 21 Nov 2002 21:23:21 -0000
  10. X-Priority: 3 (Normal)
  11. X-MSMail-Priority: Normal
  12. Importance: Normal
  13. X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
  14. Errors-To: icon-group-errors@cs.arizona.edu
  15. Status: RO
  16.  
  17. Hello -
  18.  
  19. I am sure entering a tab char by pressing the tab key would work, but in
  20. your example you are not entering it as user-input, i.e. at run time.
  21.  
  22. I was under the impression that in Perl regexps the usual style was "\t"
  23. (see 'Programming Perl', 2nd Edn., p.64).
  24.  
  25. I am really not bothered because I can substitute another character before
  26. presenting the input string to the library procedure.
  27.  
  28. The test program I am using is below (hoping the lines don't get
  29. disrupted):-
  30.  
  31. ############################################
  32. #
  33. #    Testing Icon regular expressions
  34. #
  35. ############################################
  36.  
  37. link regexp
  38.  
  39. procedure main()
  40.   write("Enter pattern (regexp)")
  41.     pattern := read()
  42.   pattern := map(pattern,"\xdd","\x7c") # vertical slash problem
  43.   write("Enter string in which pattern is to be found")
  44.     rope := read()
  45.     write("pattern is ",pattern)
  46.     write("string is ",rope)
  47.   RePat(pattern)
  48.  
  49.     write("Match positions:")
  50.     every write(ReMatch(pattern,rope))
  51.  
  52.     write("Find positions:")
  53.     every write(ReFind(pattern,rope))
  54.  
  55. end
  56.  
  57.  
  58. Regards
  59.  
  60. _John Sampson_
  61.  
  62.  
  63.